* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden; /* 防止页面整体滚动 */
    display: flex;
    flex-direction: column;
}

#header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#header h1 {
    margin-bottom: 15px;
    font-size: 28px;
    font-weight: 300;
}

.controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.language-select, .theme-select {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: white;
    color: #333;
    font-size: 14px;
    min-width: 120px;
}

.theme-select {
    min-width: 140px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: rgba(255,255,255,0.2);
    color: #000000;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.main-content {
    display: flex;
    gap: 20px;
    padding: 20px;
    /*max-width: 1400px;*/
    margin: 0 auto;
    align-items: stretch;
    flex: 1 1 auto;  /* 占满剩余高度 */
    height: auto;
    min-height: 0;
}

.sidebar-section {
    width: 320px;
    min-width: 280px;
    background: white;
    padding: 16px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    min-height: 0;
}

.workspace-header .ws-title {
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 8px;
}

.workspace-header .ws-path input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
}

.ws-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.btn.small {
    font-size: 12px;
    color: black;
    padding: 6px 10px;
}

.btn.primary { background: #4caf50; }
.btn.danger { background: #e53935; }

.file-tree {
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 8px;
    flex: 1;
    height: auto;
    min-height: 0;
    overflow: auto;
    font-size: 13px;
}

.tree-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
}

.tree-item:hover { background: #f8f9ff; }
.tree-item.active { background: #eef2ff; }

.tree-item .name { flex: 1; }
.tree-item .actions { display: none; gap: 6px; }
.tree-item:hover .actions { display: inline-flex; }

.tree-item .icon { width: 16px; text-align: center; }
.tree-children { margin-left: 16px; }

.editor-section {
    flex: 2;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

#editor-container {
    flex: 1;
    width: 1000px;
    min-width: 400px;
    height: auto;
    min-height: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.info-section {
    /*flex: 1;*/
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    min-height: 0;
    overflow: auto;
}

.info-panel {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 终端相关样式已移除 */

.info-panel-result {
    max-width: 250px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.stdin-input {
    width: 100%;
    min-height: 80px;
    max-height: 180px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    resize: vertical;
    background: #fafafa;
}

.info-panel-result h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.info-panel h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.info-panel p {
    margin-bottom: 8px;
    font-size: 14px;
}

.info-panel span {
    font-weight: 600;
    color: #764ba2;
}

#content-display {
    width: 100%;
    height: 120px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Monaco', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    resize: vertical;
    background: #fafafa;
}

/* 代码执行相关样式 */
.execution-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.execution-btn {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    background: #667eea;
    color: white;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    width: 100%;
}

.execution-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.execution-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.execution-status {
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
    font-weight: 500;
}

.execution-status.loading {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.execution-status.success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.execution-status.error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.execution-result {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 11px;
    line-height: 1.4;
}

.execution-result .result-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    white-space: pre-line;
    word-break: break-word;
}

.execution-result .result-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 8px;
    border-radius: 4px;
    margin-bottom: 8px;
    white-space: pre-line;
    word-break: break-word;
}

.execution-result .container-info {
    font-size: 10px;
    color: #666;
    margin-top: 5px;
    padding: 4px 8px;
    background: #f8f9fa;
    border-radius: 3px;
}

#footer {
    text-align: center;
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .main-content {
        flex-direction: column;
    }
    
    .editor-section {
        flex: none;
    }
    
    .info-section {
        flex: none;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .language-select {
        min-width: auto;
    }
    
    .btn {
        width: 100%;
    }
    
    #header h1 {
        font-size: 24px;
    }
    
    .main-content {
        padding: 15px;
    }
    
    #editor-container {
        height: 400px;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* 操作记录样式 */
#user-action-log {
    max-height: 600px;
    overflow-y: auto;
    font-size: 12px;
    line-height: 1.4;
    padding: 5px 0;
}

.log-entry {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 8px;
    position: relative;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, #d0d0d0, transparent);
}

.log-action {
    flex: 1;
    color: #333;
    word-break: break-word;
    margin-right: 10px;
}

.log-timestamp {
    color: #666;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* 操作记录面板的特殊样式 */
.info-panel-log {
    max-width: 200px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
} 